﻿namespace zijian666.Data;

public readonly record struct DBValue
{
    public DBValue(object? value)
    {
        if (value is DBValue db)
        {
            Value = db.Value;
        }
        else
        {
            Value = value ?? DBNull.Value;
        }
    }

    public object Value { get; }

    public string? TypeName { get; init; }

    public override string ToString()
    {
        return Value?.ToString();
    }
}